<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <!-- header -->
    <%@ include file="/WEB-INF/views/include/header.jsp" %>
    <link rel="stylesheet" href="<s:url value="/assets/css/main.css"></s:url>"/>
</head>
<style>
    body {
        background: #fff;
    }

    .yc {
        display: none;
    }

    p {
        margin-bottom: 20px;
    }

    .information2 {
        border: 1px solid #ccc;
        padding-top: 8px;
        padding-bottom: 8px;
        margin-bottom: 10px;
    }
</style>
<body>
<%--上传成功模态框--%>
<div class="shade" style="display: none;"></div>
<div class="warning" style="display: none;">
    <p class="title"><em></em><span class="close">X</span></p>
    <p class="cont"></p>
    <div class="la-square-jelly-box la-3x">
        <div></div>
        <div></div>
    </div>
</div>

<form:form commandName="taskMain" cssClass="form-horizontal" role="form" onsubmit="return false;"
           enctype="multipart/form-data" id="updateForm">

    <div class="row">
        <div class="form-group">
            <label class="control-label col-sm-offset-1 col-sm-1">任务名称</label>
            <div class="col-sm-9">
                <input type="text" value="${taskMain.mainName}" class="form-control" readonly>
            </div>
        </div>
        <c:if test="${not empty taskMain.content}">
            <div class="form-group">
                <label class="control-label col-sm-offset-1 col-sm-1">任务内容</label>
                <div class="col-sm-9">
                    <input type="text" value="${taskMain.content}" class="form-control" readonly>
                </div>
            </div>
        </c:if>

        <c:if test="${not empty taskRank.evaluations}">
            <div class="form-group">
                <label class="control-label col-sm-offset-1 col-sm-1">本轮督办评价</label>
                <div class="col-sm-9">
                    <input type="text" value="${taskRank.evaluations}" class="form-control" readonly>
                </div>
            </div>
        </c:if>


        <div class="form-group">
            <label class="control-label col-sm-offset-1 col-sm-1">子事项</label>
            <div class="col-sm-9">
                <input type="text" value="${taskUnit.taskSubName}" class="form-control" readonly>
            </div>
        </div>

        <div class="form-group">
            <label class="control-label col-sm-offset-1 col-sm-1">攻坚任务附件:</label>
            <div class="col-sm-9">
                <c:if test="${not empty taskMain.gJFile}">
                    <c:forEach items="${taskMain.gJFile}" var="fileMap">
                        <div style="margin-bottom:15px;">
                            <input style="width: 70%;" type="text" class="fileName" readonly
                                   title="${fileMap.fileName}"
                                   value="${fileMap.fileName}" onclick="copyFile(this)">
                            <button class="btn btn-primary file" onclick="download(this)"
                                    FileSysId="${fileMap.file}">
                                下载附件
                            </button>
                        </div>
                    </c:forEach>
                </c:if>
                <c:if test="${empty taskMain.gJFile}">
                    <input type="text" value="无附件" class=" col-sm-3 form-control" readonly>
                </c:if>
            </div>
        </div>
            <%--<div class="form-group">--%>
            <%--<label class="control-label col-sm-1 no-padding-right">任务附件</label>--%>
            <%--<c:if test="${not empty taskMain.files}">--%>
            <%--<c:forEach items="${taskMain.files}" var="fileMap">--%>
            <%--${fileMap.file}--%>
            <%--</c:forEach>--%>
            <%--&lt;%&ndash;<div class="col-sm-8">&ndash;%&gt;--%>
            <%--&lt;%&ndash;<input type="text" readonly value="${taskMain.fileName}">&ndash;%&gt;--%>
            <%--&lt;%&ndash;<button class="btn btn-success" FileSysId ="${taskMain.file}" onclick="download(this)"><span&ndash;%&gt;--%>
            <%--&lt;%&ndash;class="glyphicon glyphicon-save"></span>下载附件&ndash;%&gt;--%>
            <%--&lt;%&ndash;</button>&ndash;%&gt;--%>
            <%--&lt;%&ndash;</div>&ndash;%&gt;--%>
            <%--</c:if>--%>
            <%--<c:if test="${empty taskMain.file}">--%>
            <%--<div class="col-sm-8">--%>
            <%--<input type="text" value="无任务附件" class="form-control" readonly>--%>
            <%--</div>--%>
            <%--</c:if>--%>
            <%--</div>--%>
            <%--循环附件下载--%>
        <div class="form-group">
            <label class="control-label col-sm-offset-1 col-sm-1">附件:</label>
            <div class="col-sm-9">
                <c:if test="${not empty taskMain.files}">
                    <c:forEach var="file" items="${taskMain.files}" >

                        <c:if test="${fn:contains(file['file'],'http')==false}">
                                <div style="margin-bottom:15px;">
                                    <input style="width: 70%;" type="text" class="fileName" readonly title="${file.fileName}"
                                           value="${file.fileName}" onclick="copyFile(this)">
                                    <button class="btn btn-primary file" onclick="download(this)" FileSysId="${file.file}">
                                        下载附件
                                    </button>
                                </div>
                        </c:if>

                        <c:if test="${fn:contains(file['file'],'http')==true}">
                                <div style="margin-bottom:15px;">
                                    <input style="width: 70%;" type="text" class="fileName" readonly title="${file.fileName}"
                                           value="${file.fileName}">
                                    <button class="btn btn-primary file downLoadFile" onclick="downLoadFile('${file.file}')">
                                        下载附件
                                    </button>
                                </div>
                        </c:if>
                    </c:forEach>
                </c:if>
                <c:if test="${empty taskMain.files}">
                    <input type="text" value="无附件" class=" col-sm-3 form-control" readonly>
                </c:if>
            </div>
        </div>
            <%-----以上为附件下载----%>
        <div class="form-group">
            <label class="control-label col-sm-offset-1 col-sm-1">牵头单位</label>
            <div class="col-sm-9">
                <input type="text" value="${leadDepts}" class="form-control" readonly>
            </div>
        </div>
        <c:forEach items="${xbDeptList}" var="xbDept">
            <div class="form-group">
                <label class="control-label col-sm-offset-1 col-sm-1">协办单位</label>
                <c:if test="${taskUnit.unitType !='1'}">
                    <div class="col-sm-9">
                        <input type="text" value="${xbDept.deptName}" class="form-control" readonly>
                    </div>
                </c:if>
                <c:if test="${taskUnit.unitType=='1'}">
                    <div class="col-sm-6">
                        <input type="text" value="${xbDept.deptName}" class="form-control" readonly>
                    </div>
                    <div class="col-sm-2">
                        <button class="btn btn-sm btn-info assist" taskUnitSysId="${xbDept.sysId}">查看</button>
                        <button class="btn btn-sm btn-info urge" taskUnitSysId="${xbDept.sysId}">催办</button>
                    </div>
                </c:if>
            </div>
        </c:forEach>
        <div class="form-group">
            <label class="control-label col-sm-offset-1 col-sm-1">已反馈单位</label>
            <div class="col-sm-9">
                <input type="text" value="${feedBacks}" class="form-control" readonly>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-sm-offset-1 col-sm-1">未反馈单位</label>
            <div class="col-sm-8">
                <input type="text" value="${noFeedBacks}" class="form-control" readonly>
            </div>
        </div>
    </div>
    <c:if test="${!empty leaderMessages}">
        <h3 class="col-sm-offset-5">领导批示信息</h3>
        <c:forEach items="${leaderMessages}" var="leaderMessage">
            <div class="form-group">
                <label class="control-label col-sm-offset-1 col-sm-1">姓名:</label>
                <div class="col-sm-4">
                    <input type="text" value="${leaderMessage.createUserName}" class=" col-sm-3 form-control" readonly>
                </div>
                <label class="control-label col-sm-1">时间:</label>
                <div class="col-sm-4">
                    <input type="text" value="${leaderMessage.createDate} ${leaderMessage.createTime}"
                           class=" col-sm-3 form-control" readonly>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-sm-offset-1 col-sm-1">批示信息:</label>
                <div class="col-sm-9">
                                <textarea rows="3" readonly class="form-control FeedbackContent"
                                          type="text"
                                          style="resize: vertical;min-height: 50px">${leaderMessage.content}</textarea>
                </div>
            </div>
        </c:forEach>
    </c:if>

    <c:if test="${taskMain.imp==2}">
        <div class="form-group clearfix "  >
            <div class="col-sm-8 col-sm-offset-2 row" id="Feedback">
                <h3>反馈给作战室：</h3>
                <div class="information2 row">
                    <div>
                        <div class="form-group">
                            <div>
                                <label class="col-sm-1 col-sm-offset-1 control-label">办理情况</label>
                                <div class="col-sm-9">
                                    <textarea rows="3" class="form-control FeedbackContent" id="FeedbackContent_bnqk"
                                              placeholder="请输入办理情况"
                                              style="resize: vertical;min-height: 50px;"></textarea>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <div>
                                <label class="col-sm-1 col-sm-offset-1 control-label">存在问题</label>
                                <div class="col-sm-9">
                                    <textarea rows="3" class="form-control FeedbackContent" id="FeedbackContent_czwt"
                                              placeholder="请输入存在问题"
                                              style="resize: vertical;min-height: 50px;"></textarea>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <div>
                                <label class="col-sm-1 col-sm-offset-1 control-label">下一步计划</label>
                                <div class="col-sm-9">
                                    <textarea rows="3" class="form-control FeedbackContent" id="FeedbackContent_xbjh"
                                              placeholder="请输入下一步计划"
                                              style="resize: vertical;min-height: 50px;"></textarea>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <div>
                                <label class="col-sm-1 col-sm-offset-1 control-label">反馈附件</label>
                                    <%--<div class="col-sm-7 pos-rel">--%>
                                <div class="col-sm-9">
                                    <div id="uploader"></div>
                                        <%--<input type="file" class="form-control" id="fileupload">--%>
                                </div>
                                    <%--<div class="col-sm-2">--%>
                                    <%--<button class="btn btn-info" onclick="uploadFile(this,'file','fileName')">--%>
                                    <%--<span class="glyphicon glyphicon-open"></span>上传附件--%>
                                    <%--</button>--%>
                                    <%--</div>--%>
                            </div>
                        </div>

                    </div>
                    <div class="row">
                        <div class="col-sm-offset-3 col-sm-1">
                            <button class="btn btn-info btn-sm FeedbackConfirm" onclick="FeedbackConfirm()">确定</button>
                        </div>
                        <div class="col-sm-offset-4 col-sm-1">
                            <button class="btn btn-info btn-sm ">取消</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </c:if>

    <c:if test="${empty taskBackNewList}">
        <h3 class="col-sm-offset-5">反馈内容</h3>

        <div class="form-group">
            <label class="control-label col-sm-offset-1 col-sm-1">反馈状态:</label>
            <div class="col-sm-4">
                <label class="control-label">未反馈</label>
            </div>
        </div>

        <div class="form-group">
            <label class="control-label col-sm-offset-1 col-sm-1">办理情况:</label>
            <div class="col-sm-9">
                                <textarea rows="3" FeedbackContent="#FeedbackContent1" readonly class="form-control"
                                          type="text" style="resize: vertical;min-height: 50px"></textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-sm-offset-1 col-sm-1">存在问题:</label>
            <div class="col-sm-9">
                            <textarea rows="3" onclick="FeedbackContent(this)" FeedbackContent="#FeedbackContent2"
                                      readonly class="form-control"
                                      type="text" style="resize: vertical;min-height: 50px"></textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="control-label col-sm-offset-1 col-sm-1">下一步计划:</label>
            <div class="col-sm-9">
                            <textarea rows="3" readonly onclick="FeedbackContent(this)"
                                      FeedbackContent="#FeedbackContent3" class="form-control"
                                      type="text" style="resize: vertical;min-height: 50px"></textarea>
            </div>
        </div>
    </c:if>
    <c:if test="${!empty taskBackNewList}">
        <h3 class="col-sm-offset-5">反馈内容</h3>
        <c:forEach var="taskBackNew" items="${taskBackNewList}">
            <div class="row">
                <div class="form-group">
                    <label class="control-label col-sm-offset-1 col-sm-1">反馈单位1:</label>
                    <div class="col-sm-9">
                        <input type="text" class="form-control" value="${taskBackNew.deptName}" readonly>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-sm-offset-1 col-sm-1">反馈人:</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" value="${taskBackNew.senderName}" readonly>
                    </div>
                    <label class="control-label col-sm-1">反馈时间:</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control"
                               value="${taskBackNew.createDate} ${taskBackNew.createTime}" readonly>
                    </div>
                </div>
                <div class="form-group">
                        <%--<label class="control-label col-sm-offset-1 col-sm-1">附件:</label>--%>
                        <%--<div class="col-sm-4">--%>
                        <%--<c:if test="${not empty taskBackNew.file}">--%>
                        <%--<input type="text" readonly value="${taskBackNew.fileName}">--%>
                        <%--<button class="btn btn-primary" FileSysId="${taskBackNew.file}" onclick="download(this)">--%>
                        <%--下载附件--%>
                        <%--</button>--%>
                        <%--</c:if>--%>
                        <%--<c:if test="${empty taskBackNew.file}">--%>
                        <%--<input type="text" value="无附件" class=" col-sm-3 form-control" readonly>--%>
                        <%--</c:if>--%>
                        <%--</div>--%>
                    <label class="control-label col-sm-offset-1 col-sm-1">反馈状态:</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control"
                               value="${taskBackNew.status == 0 ? "未处理" :taskBackNew.status == 1 ? "办结" : taskBackNew.status == 2 ? "退回重办" : taskBackNew.status == 3 ? "已反馈" : "未知"}"
                               readonly>
                    </div>
                </div>
                    <%--循环附件下载--%>
                <div class="form-group">
                    <label class="control-label col-sm-offset-1 col-sm-1">附件:</label>
                    <div class="col-sm-9">
                        <c:if test="${not empty taskBackNew.files}">
                            <c:forEach items="${taskBackNew.files}" var="fileMap">
                                <div style="margin-bottom:15px;">
                                    <input style="width: 70%;" type="text" class="fileName" readonly
                                           title="${fileMap.fileName}"
                                           value="${fileMap.fileName}" onclick="copyFile(this)">
                                    <button class="btn btn-primary file" onclick="download(this)"
                                            FileSysId="${fileMap.file}">
                                        下载附件
                                    </button>
                                </div>
                            </c:forEach>
                        </c:if>
                        <c:if test="${empty taskBackNew.files}">
                            <input type="text" value="无附件" class=" col-sm-3 form-control" readonly>
                        </c:if>
                    </div>
                </div>
                    <%-----以上为附件下载----%>
                <div class="form-group">
                    <label class="control-label col-sm-offset-1 col-sm-1">办理情况:</label>
                    <div class="col-sm-9">
                                <textarea rows="3" onclick="FeedbackContent(this)" FeedbackContent="#FeedbackContent1"
                                          readonly class="form-control"
                                          type="text"
                                          style="resize: vertical;min-height: 50px">${taskBackNew.content}</textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-sm-offset-1 col-sm-1">存在问题:</label>
                    <div class="col-sm-9">
                            <textarea rows="3" onclick="FeedbackContent(this)" FeedbackContent="#FeedbackContent2"
                                      readonly class="form-control"
                                      type="text"
                                      style="resize: vertical;min-height: 50px">${taskBackNew.problem}</textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-sm-offset-1 col-sm-1">下一步计划:</label>
                    <div class="col-sm-9">
                            <textarea rows="3" readonly onclick="FeedbackContent(this)"
                                      FeedbackContent="#FeedbackContent3" class="form-control"
                                      type="text"
                                      style="resize: vertical;min-height: 50px">${taskBackNew.plan}</textarea>
                    </div>
                </div>
                <c:if test="${taskBackNew.status == 3}">
                    <div class="form-group" id="zhuangtai">
                        <label class="col-sm-offset-2 control-label col-sm-1">是否办结:</label>
                        <div class="col-sm-2">
                            <select class="form-control zt" onchange="sfbanjie(this)">
                                <option value=" ">点击选择</option>
                                <option value="1">办结</option>
                                <option value="2">退回重办</option>
                                    <%--<option value="3">提请领导审阅是否办结</option>--%>
                            </select>
                        </div>
                        <label class="control-label col-sm-1 yc">评价:</label>
                        <div class="col-sm-2 yc">
                            <select class="form-control hg" onchange="hege(this)">
                                <option value="1">好</option>
                                <option value="2">中</option>
                                <option value="2">差</option>
                            </select>
                        </div>
                    </div>
                    <c:if test="${taskUnit.timeType == 2}">
                        <div class="form-group timeTypeDiv" style="display: none">
                            <div class="col-sm-offset-3 col-sm-5">
                                <label class="checkbox-inline">
                                    <input type="checkbox" value="1" class="timeType">是否结束周期性任务
                                </label>
                            </div>
                        </div>
                    </c:if>
                    <div class="row updataBackNew">
                        <div class="col-sm-offset-8 col-sm-4">
                            <button class="btn btn-sm btn-info updataBackNewbtn" taskBackNewSysId="${taskBackNew.sysId}"
                                  >
                                确定
                            </button>
                        </div>
                    </div>
                </c:if>
            </div>
            <hr/>
        </c:forEach>
    </c:if>

    <div style="display: none">
        <form:form commandName="taskSub" cssClass="form-horizontal" role="form" onsubmit="return false;"
                   id="feedbackForms">

            <div class="form-group">
                <label class="col-sm-offset-1 col-sm-1 text-right ">汇总办理情况：</label>
                <div class="col-sm-8">
                    <textarea rows="2" class="form-control" id="FeedbackContent1" name="subSituation"
                              style="resize: vertical;min-height: 50px">${taskSub.subSituation}</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-offset-1 col-sm-1 text-right ">汇总存在问题：</label>
                <div class="col-sm-8">
                    <textarea rows="2" class="form-control" id="FeedbackContent2" name="subProblem"
                              style="resize: vertical;min-height: 50px">${taskSub.subProblem}</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-offset-1 col-sm-1 text-right ">汇总下一步计划：</label>
                <div class="col-sm-8">
                    <textarea rows="2" class="form-control" id="FeedbackContent3" name="subPlan"
                              style="resize: vertical;min-height: 50px">${taskSub.subPlan}</textarea>
                </div>
            </div>
            <input type="text" hidden value="${taskSub.sysId}" name="sysId">
            <div class="form-group">
                <label class="control-label col-sm-1 col-sm-offset-1">反馈汇总附件:</label>
                <div class="col-sm-8">
                        <%--  <c:if test="${not empty taskSub.subSituationFile}">
                              &lt;%&ndash;下载&ndash;%&gt;
                              <input type="text" readonly value="${taskSub.fileName}">
                              <button class="btn btn-primary" FileSysId="${taskSub.subSituationFile}" onclick="download(this)"><span class="glyphicon glyphicon-save"></span>下载附件</button>
                          </c:if>--%>
                    <c:if test="${not empty taskSub.subSituationFile}">
                        <c:forEach items="${taskSub.subSituationFile}" var="fileMap">
                            <div style="margin-bottom:15px;">
                                <input style="width: 70%;" type="text" class="fileName" readonly
                                       title="${fileMap.fileName}"
                                       value="${fileMap.fileName}" onclick="copyFile(this)">
                                <button class="btn btn-primary file" onclick="download(this)"
                                        FileSysId="${fileMap.file}">
                                    下载附件
                                </button>
                            </div>
                        </c:forEach>
                    </c:if>
                    <c:if test="${empty taskSub.subSituationFile}">
                        <input type="text" value="无附件" class=" col-sm-3 form-control" readonly>
                    </c:if>

                    <div>
                            <%--上传--%>
                            <%--<div style="display: inline-block">--%>
                            <%--<input type="file" class="fileBorder" id="fileupload">--%>
                            <%--</div>--%>
                        <div style="display: inline-block">
                            <div id="uploader"></div>
                                <%--<button class="btn btn-info" onclick="uploadFile(this,'subSituationFile','fileName')">--%>
                                <%--<span class="glyphicon glyphicon-open"></span>上传附件--%>
                                <%--</button>--%>
                        </div>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-8">
                    <input type="button" id="submitFormButton" class="btn-sm btn-success" value="确定保存"
                           style="border-radius: 5px">
                    <input type="button" id="handle" class="btn-sm btn-success" value="办理情况导出"
                           style="border-radius: 5px">
                </div>
            </div>
        </form:form>
    </div>
    <c:if test="${not empty oldTask}">
        <div class="form-group clearfix">
            <div class="col-sm-8 col-sm-offset-2 row uploadList">
                <p>历史记录:</p>
                <div class="row">
                    <c:forEach items="${oldTask}" var="old" varStatus="oldindex">
                        <div class="form-group" style="margin: 0">
                            <div class="panel panel-default ">
                                <div class="panel-heading">
                                    <h4 class="panel-title">
                                        <a data-toggle="collapse" data-parent="#accordion"
                                           href="#collapse${oldindex.index}">
                                            第${old.taskUnit.timeRound}轮任务
                                        </a>
                                    </h4>
                                </div>
                                <div id="collapse${oldindex.index}" class="panel-collapse collapse">
                                    <div class="panel-body">
                                        <c:forEach items="${old.backNewList}" var="backNew">
                                            <c:choose>
                                                <c:when test="${backNew.createUser == sysLogin.sysId}">
                                                    <h6>我反馈的</h6>
                                                    <div class="form-group">
                                                        <label class="control-label col-sm-offset-1 col-sm-1">反馈日期:</label>
                                                        <div class="col-sm-4">
                                                            <input type="text" class="form-control"
                                                                   value=" ${backNew.createDate} ${backNew.createTime}"
                                                                   readonly>
                                                        </div>
                                                            <%--<label class="control-label col-sm-1">反馈时间:</label>
                                                            <div class="col-sm-4">
                                                                <input type="text" class="form-control"
                                                                       value=" ${backNew.createTime}" readonly>
                                                            </div>--%>
                                                    </div>
                                                    <div class="form-group">
                                                            <%--<label class="control-label col-sm-offset-1 col-sm-1">附件:</label>--%>
                                                            <%--<div class="col-sm-4">--%>
                                                            <%--<c:if test="${not empty backNew.file}">--%>
                                                            <%--<input type="text" readonly value="${backNew.fileName}">--%>
                                                            <%--<button class="btn btn-primary" FileSysId="${backNew.file}" onclick="download(this)">--%>
                                                            <%--下载附件--%>
                                                            <%--</button>--%>
                                                            <%--</c:if>--%>
                                                            <%--<c:if test="${empty backNew.file}">--%>
                                                            <%--<input type="text" value="无附件" class=" col-sm-3 form-control" readonly>--%>
                                                            <%--</c:if>--%>
                                                            <%--</div>--%>
                                                        <label class="control-label col-sm-offset-1 col-sm-1">反馈状态:</label>
                                                        <div class="col-sm-4">
                                                            <input type="text" class="form-control"
                                                                   value="${backNew.status == 0 ? "未处理" :backNew.status == 1 ? "合格" : backNew.status == 2 ? "退回重办" :backNew.status == 3 ? "已反馈" : "未知"}"
                                                                   readonly>
                                                        </div>
                                                    </div>
                                                    <%--循环附件下载--%>
                                                    <div class="form-group">
                                                        <label class="control-label col-sm-offset-1 col-sm-1">附件:</label>
                                                        <div class="col-sm-9">
                                                            <c:if test="${not empty backNew.files}">
                                                                <c:forEach items="${backNew.files}" var="fileMap">
                                                                    <div style="margin-bottom:15px;">
                                                                        <input style="width: 70%;" type="text"
                                                                               class="fileName" readonly
                                                                               title="${fileMap.fileName}"
                                                                               value="${fileMap.fileName}"
                                                                               onclick="copyFile(this)">
                                                                        <button class="btn btn-primary file"
                                                                                onclick="download(this)"
                                                                                FileSysId="${fileMap.file}">
                                                                            下载附件
                                                                        </button>
                                                                    </div>
                                                                </c:forEach>
                                                            </c:if>
                                                            <c:if test="${empty backNew.files}">
                                                                <input type="text" value="无附件"
                                                                       class=" col-sm-3 form-control" readonly>
                                                            </c:if>
                                                        </div>
                                                    </div>
                                                    <%-----以上为附件下载----%>
                                                    <div class="form-group">
                                                        <label class="control-label col-sm-offset-1 col-sm-1">办理情况:</label>
                                                        <div class="col-sm-9">
                                                <textarea rows="3" readonly class="form-control " title="点击复制"
                                                          style="resize: vertical;min-height: 50px"
                                                          type="text">${backNew.content}</textarea>
                                                        </div>
                                                    </div>
                                                    <div class="form-group">
                                                        <label class="control-label col-sm-offset-1 col-sm-1">存在问题:</label>
                                                        <div class="col-sm-9">
                                                <textarea rows="3" readonly class="form-control " title="点击复制"
                                                          style="resize: vertical;min-height: 50px"
                                                          type="text">${backNew.problem}</textarea>
                                                        </div>
                                                    </div>
                                                    <div class="form-group">
                                                        <label class="control-label col-sm-offset-1 col-sm-1">下一步计划:</label>
                                                        <div class="col-sm-9">
                                                <textarea rows="3" readonly class="form-control " title="点击复制"
                                                          style="resize: vertical;min-height: 50px"
                                                          type="text">${backNew.plan}</textarea>
                                                        </div>
                                                    </div>
                                                    <hr/>
                                                </c:when>
                                                <c:otherwise>
                                                    <h6>反馈我的</h6>
                                                    <div class="form-group clearfix">
                                                        <label class="control-label col-sm-offset-1 col-sm-1">反馈人:</label>
                                                        <div class="col-sm-4">
                                                            <input type="text" class="form-control"
                                                                   value="${backNew.senderName}" readonly>
                                                        </div>
                                                        <label class="control-label col-sm-1">反馈时间:</label>
                                                        <div class="col-sm-4">
                                                            <input type="text" class="form-control"
                                                                   value="${backNew.createDate} ${backNew.createTime}"
                                                                   readonly>
                                                        </div>
                                                    </div>
                                                    <div class="form-group clearfix">
                                                            <%--<label class="control-label col-sm-offset-1 col-sm-1">附件:</label>--%>
                                                            <%--<div class="col-sm-4">--%>
                                                            <%--<c:if test="${not empty backNew.file}">--%>
                                                            <%--<input type="text" readonly value="${backNew.fileName}">--%>
                                                            <%--<button class="btn btn-primary" FileSysId="${backNew.file}" onclick="download(this)">--%>
                                                            <%--下载附件--%>
                                                            <%--</button>--%>
                                                            <%--</c:if>--%>
                                                            <%--<c:if test="${empty backNew.file}">--%>
                                                            <%--<input type="text" value="无附件" class=" col-sm-3 form-control" readonly>--%>
                                                            <%--</c:if>--%>
                                                            <%--</div>--%>
                                                        <label class="control-label col-sm-offset-1 col-sm-1">反馈状态:</label>
                                                        <div class="col-sm-4">
                                                            <input type="text" class="form-control"
                                                                   value="${backNew.status == 0 ? "未处理" :backNew.status == 1 ? "合格" : backNew.status == 2 ? "退回重办" :backNew.status == 3 ? "已反馈" : "未知"}"
                                                                   readonly>
                                                        </div>
                                                    </div>
                                                    <%--循环附件下载--%>
                                                    <div class="form-group">
                                                        <label class="control-label col-sm-offset-1 col-sm-1">附件:</label>
                                                        <div class="col-sm-9">
                                                            <c:if test="${not empty backNew.files}">
                                                                <c:forEach items="${backNew.files}" var="fileMap">
                                                                    <div style="margin-bottom:15px;">
                                                                        <input style="width: 70%;" type="text"
                                                                               class="fileName" readonly
                                                                               title="${fileMap.fileName}"
                                                                               value="${fileMap.fileName}"
                                                                               onclick="copyFile(this)">
                                                                        <button class="btn btn-primary file"
                                                                                onclick="download(this)"
                                                                                FileSysId="${fileMap.file}">
                                                                            下载附件
                                                                        </button>
                                                                    </div>
                                                                </c:forEach>
                                                            </c:if>
                                                            <c:if test="${empty backNew.files}">
                                                                <input type="text" value="无附件"
                                                                       class=" col-sm-3 form-control" readonly>
                                                            </c:if>
                                                        </div>
                                                    </div>
                                                    <%-----以上为附件下载----%>
                                                    <div class="form-group clearfix">
                                                        <label class="control-label col-sm-offset-1 col-sm-1">办理情况:</label>
                                                        <div class="col-sm-9">
                                                <textarea rows="3" readonly class="form-control " title="点击复制"
                                                          style="resize: vertical;min-height: 50px"
                                                          type="text">${backNew.content}</textarea>
                                                        </div>
                                                    </div>
                                                    <div class="form-group clearfix">
                                                        <label class="control-label col-sm-offset-1 col-sm-1">存在问题:</label>
                                                        <div class="col-sm-9">
                                                <textarea rows="3" readonly class="form-control " title="点击复制"
                                                          style="resize: vertical;min-height: 50px"
                                                          type="text">${backNew.problem}</textarea>
                                                        </div>
                                                    </div>
                                                    <div class="form-group clearfix">
                                                        <label class="control-label col-sm-offset-1 col-sm-1">下一步计划:</label>
                                                        <div class="col-sm-9">
                                                <textarea rows="3" readonly class="form-control " title="点击复制"
                                                          style="resize: vertical;min-height: 50px"
                                                          type="text">${backNew.plan}</textarea>
                                                        </div>
                                                    </div>
                                                    <hr/>
                                                </c:otherwise>
                                            </c:choose>
                                        </c:forEach>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </c:forEach>
                </div>
            </div>
        </div>
    </c:if>
    <div class="form-group clearfix">
        <h3 class="col-sm-offset-5">督办流程记录</h3>
        <div class="flowPath col-sm-offset-2">
            <p>任务名称:<span style="margin-left: 20px">${mainName}</span></p>
            <p>议定事项:<span style="margin-left: 20px">${taskSubName}</span></p>
            <c:forEach var="logNew" items="${logNewList}" varStatus="num">
                <div class="row">
                    <div class="col-sm-8"><span style="font-weight: bold;margin-right: 20px">${num.count}.</span>
                        <span style="font-weight: normal;margin-right: 20px"> ${logNew.createDate} ${logNew.createTime}</span>
                        <span style="font-weight: normal;">${logNew.content}</span></div>
                        <%--<button class="btn-sm btn btn-info col-sm-1 urge" btnSysId = "${logNew.sysId}">催办</button>--%>
                </div>
            </c:forEach>
        </div>
    </div>

    <input type="hidden" class="taskMainId" value="${taskSub.taskMainId}">
    <input type="hidden" class="taskUnitId" id ="taskUnitId" value="${taskUnit.sysId}">

</form:form>

<!-- footer -->

<%@ include file="/WEB-INF/views/include/footer.jsp" %>
<%--多选上传--%>
<script src="<s:url value="/assets/js/dist/easyUploader.jq.js"></s:url>"></script>

<script src="<s:url value="/assets/js/chosen.jquery.js"></s:url>"></script>
<script src="<s:url value="/assets/js/ajaxfileupload.js"></s:url>"></script>
<script src="<s:url value="/assets/js/modal/modal.js"></s:url>"></script>
<script src="<s:url value="/assets/js/own.js"></s:url>"></script>

<script>
    <%--多文件上传--%>
    var fileStr = "";//id字符串拼接
    var fileNameStr = "";//文件名字符串拼接
    var uploader = easyUploader({
        id: "uploader",
        accept: '.jpg,.png,.doc,.docx,.pdf,.xls,.xlsx,.ppt,.pptx',
        action: '/filesUpload/uploadFiles',
        dataFormat: 'formData',
        maxCount: 10,//允许上传的个数
        maxSize: 2000,//允许上传最大的容量
        multiple: true,
        data: null,
        beforeUpload: function (file, data, args) {
        },
        onChange: function (fileList) {
        },
        onRemove: function (removedFiles, files) {
            console.log('onRemove', removedFiles);
        },
        onSuccess: function (res) {
            console.log('onSuccess', res);
            if (res.data !== undefined && res.data[0] !== undefined) {
                //拼接文件id 和 文件名
                fileStr += res.data[0].sysid + ",";
                fileNameStr += res.data[0].oldName + ",";
            }
        },
        onError: function (err) {
            console.log('onError', err);
        },
    });
</script>
<script type="text/javascript">
    function hege(data) {
        var $btn = $(data).parent().parent().siblings(".updataBackNew").find("button");
        var hg = $(data).val();
        $(data).parent().parent().siblings(".timeTypeDiv").show();
        /*if (hg == 1){
            $(data).parent().parent().siblings(".timeTypeDiv").show();
        }else{
            $(data).parent().parent().siblings(".timeTypeDiv").hide().find(".timeType").attr("checked",false);
        }*/
        $btn.attr("hg", hg);
    }

    /**
     *是否办结  sfbanjie
     */
    function sfbanjie(data) {
        $(data).parent().parent().siblings(".timeTypeDiv").hide().find(".timeType").attr("checked", false);
        var $btn = $(data).parent().parent().siblings(".updataBackNew").find("button");
        var zt = $(data).val();
        /* if (zt == 1) {
             $(data).parent().siblings(".yc").show();
             $(data).parent().parent().siblings(".timeTypeDiv").show()
         } else {
             $(data).parent().siblings(".yc").hide();
             // $(data).parent().siblings(".yc").find(".hg").val(" ");
             $btn.removeAttr("hg")
         }*/
        $btn.attr("zt", zt);
    }

    $('.updataBackNewbtn').click(function () {
        console.log("banjie")
        failure(".updataBackNewbtn", 1)
        var taskBackNewSysId = $(this).attr("taskBackNewSysId");
        var hg = $(this).attr("hg");
        var zt = $(this).attr("zt");
        var end = $(".timeType:checked").val();
        if (!end) {
            end = 0;
        }
        var datas = {};
        if (!hg) {
            datas = {
                sysId: taskBackNewSysId,
                status: zt,
            }
        } else {
            datas = {
                sysId: taskBackNewSysId,
                status: zt,
                comment: hg,
                end: end
            }
        }
        $.post("/taskMain/updateBackNew/", datas, function (data) {
            if (data == "200") {
                alert("处理成功");
                setTimeout(function () {
                    open(location, '_self').close();
                }, 50)
            } else if (data == "500") {
                alert("处理失败,请重新处理")
            }
            failure(".updataBackNewbtn", 0)
        })
    })

    /**
     * 动态获取反馈内容
     */
    function FeedbackContent(e) {
        var $FeedbackContent = $(e).attr("FeedbackContent");
        var html = $($FeedbackContent).val();
        var text = $(e).val();
        html += text + "；";
        $($FeedbackContent).val(html);
    }

    /*办理实现导出*/
    $("#handle").click(function () {
        var taskMainId = $(".taskMainId").val();
        window.open("/taskMain/exportTaskMain?sysId=" + taskMainId);
    })

    //提交
    $("#submitFormButton").click(function () {
        failure("#submitFormButton", 1)
        var datas = {
            subSituation: $("textarea[name='subSituation']").val(),
            subProblem: $("textarea[name='subProblem']").val(),
            subPlan: $("textarea[name='subPlan']").val(),
            subSituationFile: fileStr,//sysid
            sysId: $("input[name='sysId']").val(),
            fileName: fileNameStr //文件名
        }
        /* var datas = {
             content : $("textarea[name='subSituation']").val(),
             problem : $("textarea[name='subProblem']").val(),
             plan : $("textarea[name='subPlan']").val(),
             file:fileStr,//sysid
             sysId:$("input[name='sysId']").val(),
             fileName: fileNameStr //文件名
         }*/
        $.ajax({
            url: "/taskMain/collect/",
            data: datas,
            dataType: "text",
            type: "post",
            success: function (data) {

                console.log(data)
                if (data === "200") {
                    alert("保存成功");
                    setTimeout(function () {
                        open(location, '_self').close();
                    }, 50)
                } else {
                    alert("保存失败");
                }
                failure("#submitFormButton", 0)
            }
        })
    })
    function downLoadFile(url) {
        window.open(url);
    };
</script>
<script>
    /**
     *  反馈给作战室
     */

    function FeedbackConfirm() {
        failure(".FeedbackConfirm", 1)
        var FeedbackContent1 = $("#FeedbackContent_bnqk").val();//办理情况
        var FeedbackContent2 = $("#FeedbackContent_czwt").val();//存在问题
        var FeedbackContent3 = $("#FeedbackContent_xbjh").val();//下步问题
        var sysId = $("#taskUnitId").val();
        var FeedbackName = $("#recipientId").val();
        var taskMainId = $(".taskMainId").val();
        console.log(sysId)
        if (!FeedbackContent1) {
            failure(".FeedbackConfirm", 0)
            return alert("请输入办理情况")
        }

        var datas = {
            content: FeedbackContent1,
            problem: FeedbackContent2, //存在问题
            plan: FeedbackContent3,  //下一步计划
            //recipientId: FeedbackName,
            taskUnitId: sysId,
            file: fileStr,
            fileName: fileNameStr,
            taskMainId:taskMainId
        }
        $.post("/taskUnit/gongjianback", datas, function (data) {
            if (data.code == 200) {
                alert(data.message);
                setTimeout(function () {
                    //刷新当前页面
                    open(location, '_self').close();
                }, 50)
            } else {
                alert(data.message);
            }
            failure(",FeedbackConfirm", 0)
        })

    }
</script>
</body>
</html>